<?php
session_start();
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../../model/Service/MemberService.php';
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../../model/Context/BaseContext.php';
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../../model/ServiceResult/ServiceResult.php';

require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../../_config/setting/global.setting.php';
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../../_config/setting/SMTPConfig.php';
require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../../_config/setting/orderNumber.php';

if (!file_exists(dirname(__FILE__).DIRECTORY_SEPARATOR.'../../_config/setting/PageConfig.php'))
{
	echo "Configuration file not found!";
}
else
{
	require_once dirname(__FILE__).DIRECTORY_SEPARATOR.'../../plugin/Config/Config.php';
}
if(isset($_GET['type']) && isset($_GET['action']))
{
	$context = new BaseContext();
	$result = new ServiceResult();
	$type = $_GET['type'];
	$action = $_GET['action'];
	
	switch ($type) {
		case "user":
			include 'process/user.php';
			break;
				
		case "fact":
			include 'process/fact.php';
			break;
				
		case "cus":
			include 'process/cus.php';
			break;

		case "pass":
			include 'process/pass.php';
			break;
				
		case "bank":
			include 'process/bank.php';
			break;

		case "article":
			include 'process/article.php';
			break;
				
		case "order":
			include 'process/order.php';
			break;
				
		case "purchaseOrder":
			include 'process/purchaseOrder.php';
			break;
				
		case "l":
			include 'process/l.php';
			break;
				
		case "config":
			include 'process/config.php';
			break;

		case "ship":
			include 'process/ship.php';
			break;
				
		case "pi":
			include 'process/pi.php';
			break;
				
		case "payment":
			include 'process/payment.php';
			break;
				
		case "web":
			include 'process/web.php';
			break;
			
		case "invoice":
			include 'process/invoice.php';
			break;
			
		case "report":
			include 'process/report.php';
			break;
				
		default:
			echo "khong co tinh nang nay";
			break;
	}
}
else
{
	echo "ERROR";
}